home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / extenbat.arc / VCOPY.BAT < prev   
DOS Batch File  |  1983-07-01  |  3KB  |  85 lines

  1. bat * VCOPY - demonstration of the READSCRN command for 80 col display *
  2. bat * Written 1/25/83
  3. bat * Copyright 1983 by Frank Canova and Seaware Corp.
  4.  
  5.  
  6. bat * Make sure that we know where data is traveling from/to
  7. bat    TYPE
  8. bat    READ Enter the wild card spec for files to be copied. (Press enter for all) %3
  9. bat    TYPE
  10. bat -rd.1 INKEY Which drive is the "from" diskette? (A, B, C, or D) %4
  11. bat    CALL -chker | %1 = %4 | IF .%4 = . GOTO -rd.1
  12. bat -rd.2 INKEY Which drive is the "to"   diskette? (A, B, C, or D) %4
  13. bat    CALL -chker | %2 = %4 | IF .%4 = . GOTO -rd.2
  14.  
  15.  
  16. bat * Get a directory of "from" to start asking questions about.
  17. bat    CLS
  18. DIR    %1:%3/w
  19. bat
  20.  
  21. bat    STACK.ON    | * Make sure another program didn't set this off
  22. bat    * Ignore the return to BAT
  23. bat -ignore READSCRN %k | if .%k = . goto -ignore
  24. bat    * Get the number of files from the screen
  25. bat -ignore2 READSCRN %k | if .%k = . goto -ignore2
  26.  
  27.  
  28. bat * Verify that have something to copy.
  29. bat    IF %K = file type no files are available to copy. | exit
  30. bat    IF %K = 0 type no files are available to copy. | exit
  31.  
  32.  
  33. bat * Get upto 5 file names on each line.
  34. bat -read.dline READSCRN %A %B %C %D %E %F %G %H %I %J
  35. bat    IF %R = 2 GOTO -query    | * If at top of screen, ignore orig DIR cmd.
  36.  
  37.  
  38. bat * Save on the keyboard stack all the file names if they exist.
  39. bat    IF .%A <> . STACK %A.%B
  40. bat    IF .%C <> . STACK %C.%D
  41. bat    IF .%E <> . STACK %E.%F
  42. bat    IF .%G <> . STACK %G.%H
  43. bat    IF .%I <> . STACK %I.%J
  44. bat    GOTO -read.dline
  45.  
  46.  
  47. bat -query CLS TYPE %k files found for copy from %1: to %2:
  48. bat    TYPE
  49. bat -q.loop READ %f        |* Read file name off of stack
  50. bat -q.loop2 TYPE Copy %F ? ;
  51. bat    INKEY %A        |* Does user want to copy this one?
  52. bat    IF %a = y TYPE Yes | SKIP 2
  53. bat    IF %a = n TYPE No  | SKIP 2
  54. bat    BEEP GOTO -q.loop2
  55. bat -q.loop.y STACK copy %1:%F %2: |* Stack the COPY command for DOS later.
  56. bat -q.loop.n  %k = %K - 1
  57. bat    IF %K <> 0 GOTO -q.loop
  58.  
  59. bat * Remove any other messages that DOS might have put on the directory
  60. bat * which might have gotten stacked during the READSCRN above.
  61. bat -clean.stack
  62. bat    IF %q = k SKIP 3
  63. bat    READ %A %B %C
  64. bat    IF %A <> copy GOTO -clean.stack
  65. bat    STACK %a %b %c
  66.  
  67.  
  68. bat * Verify that user is ready. DOS will pull the copy commands off of the
  69. bat * keyboard stack after this program ends.
  70. bat    TYPE
  71. bat    INKEY Ready to copy. Press any key when ready . . .
  72. bat    EXIT
  73.  
  74.  
  75. bat * This is a subroutine which checks the drive spec for validity.
  76. bat -chker
  77. bat    %5 = %4 # | IF %5 = 1 TYPE %4
  78. bat    IF %4 = A SKIP 4
  79. bat    IF %4 = B SKIP 3
  80. bat    IF %4 = C SKIP 2
  81. bat    IF %4 = D SKIP 1
  82. bat    BEEP
  83. bat -chk.ok RETURN
  84.  
  85.